<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>Introduction_to_Algorithms: IntroductionToAlgorithm::GraphAlgorithm::BFS_Vertex&lt; KType &gt; Struct Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Introduction_to_Algorithms
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">IntroductionToAlgorithm::GraphAlgorithm::BFS_Vertex&lt; KType &gt; Struct Template Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>BFS_Vertex：用于广度优先搜索的顶点类型，算法导论22章22.2节  
 <a href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="bfs__vertex_8h_source.html">bfs_vertex.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for IntroductionToAlgorithm::GraphAlgorithm::BFS_Vertex&lt; KType &gt;:</div>
<div class="dyncontent">
 <div class="center">
  <img src="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.png" usemap="#IntroductionToAlgorithm::GraphAlgorithm::BFS_Vertex&lt; KType &gt;_map" alt=""/>
  <map id="IntroductionToAlgorithm::GraphAlgorithm::BFS_Vertex&lt; KType &gt;_map" name="IntroductionToAlgorithm::GraphAlgorithm::BFS_Vertex&lt; KType &gt;_map">
<area href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex.html" title="Vertex：图的顶点，算法导论22章22.1节 " alt="IntroductionToAlgorithm::GraphAlgorithm::Vertex&lt; KType &gt;" shape="rect" coords="0,0,373,24"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a3f00f12565def71750f1f163e0e52305"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a3f00f12565def71750f1f163e0e52305">COLOR</a> { <a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a3f00f12565def71750f1f163e0e52305ab5bf627e448384cf3a4c35121ca6008d">COLOR::WHITE</a>, 
<a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a3f00f12565def71750f1f163e0e52305a48bf014c704c9eaae100a98006a37bf7">COLOR::GRAY</a>, 
<a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a3f00f12565def71750f1f163e0e52305a08d0012388564e95c3b4a7407cf04965">COLOR::BLACK</a>
 }<tr class="separator:a3f00f12565def71750f1f163e0e52305"><td class="memSeparator" colspan="2">&#160;</td></tr>
</td></tr>
<tr class="memitem:a62cef758843cdaeefae2fc196f6bdb46"><td class="memItemLeft" align="right" valign="top">typedef int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a62cef758843cdaeefae2fc196f6bdb46">VIDType</a></td></tr>
<tr class="separator:a62cef758843cdaeefae2fc196f6bdb46"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1e47ba34939458c68d7ccee8ebeccad2"><td class="memItemLeft" align="right" valign="top">typedef KType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a1e47ba34939458c68d7ccee8ebeccad2">KeyType</a></td></tr>
<tr class="separator:a1e47ba34939458c68d7ccee8ebeccad2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_types_struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex"><td colspan="2" onclick="javascript:toggleInherit('pub_types_struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex')"><img src="closed.png" alt="-"/>&#160;Public Types inherited from <a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex.html">IntroductionToAlgorithm::GraphAlgorithm::Vertex&lt; KType &gt;</a></td></tr>
<tr class="memitem:a14e958c58a404474853491eb811954cc inherit pub_types_struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex"><td class="memItemLeft" align="right" valign="top">typedef KType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex.html#a14e958c58a404474853491eb811954cc">KeyType</a></td></tr>
<tr class="separator:a14e958c58a404474853491eb811954cc inherit pub_types_struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a290c84c0dcf159f833c72c47a2d4d44a inherit pub_types_struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex"><td class="memItemLeft" align="right" valign="top">typedef int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex.html#a290c84c0dcf159f833c72c47a2d4d44a">VIDType</a></td></tr>
<tr class="separator:a290c84c0dcf159f833c72c47a2d4d44a inherit pub_types_struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ad9540a9d7487eea8ece6ac1b0bbfcc22"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#ad9540a9d7487eea8ece6ac1b0bbfcc22">BFS_Vertex</a> ()</td></tr>
<tr class="memdesc:ad9540a9d7487eea8ece6ac1b0bbfcc22"><td class="mdescLeft">&#160;</td><td class="mdescRight">默认构造函数，将<code>color</code>设为白色  <a href="#ad9540a9d7487eea8ece6ac1b0bbfcc22">More...</a><br /></td></tr>
<tr class="separator:ad9540a9d7487eea8ece6ac1b0bbfcc22"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abf41ef42dff5af509e9b42658882f604"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#abf41ef42dff5af509e9b42658882f604">BFS_Vertex</a> (const <a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a1e47ba34939458c68d7ccee8ebeccad2">KeyType</a> &amp;k)</td></tr>
<tr class="memdesc:abf41ef42dff5af509e9b42658882f604"><td class="mdescLeft">&#160;</td><td class="mdescRight">显式构造函数，指定<code>key</code>  <a href="#abf41ef42dff5af509e9b42658882f604">More...</a><br /></td></tr>
<tr class="separator:abf41ef42dff5af509e9b42658882f604"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3765fd695d8452180bafbb42baec744f"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a3765fd695d8452180bafbb42baec744f">BFS_Vertex</a> (const <a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a1e47ba34939458c68d7ccee8ebeccad2">KeyType</a> &amp;k, <a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a62cef758843cdaeefae2fc196f6bdb46">VIDType</a> d)</td></tr>
<tr class="memdesc:a3765fd695d8452180bafbb42baec744f"><td class="mdescLeft">&#160;</td><td class="mdescRight">显式构造函数，指定<code>key</code>和编号  <a href="#a3765fd695d8452180bafbb42baec744f">More...</a><br /></td></tr>
<tr class="separator:a3765fd695d8452180bafbb42baec744f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3f5b9ba686fae02e01cd899261fe6793"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a3f5b9ba686fae02e01cd899261fe6793">set_source</a> ()</td></tr>
<tr class="memdesc:a3f5b9ba686fae02e01cd899261fe6793"><td class="mdescLeft">&#160;</td><td class="mdescRight">set_source：设本顶点为源点  <a href="#a3f5b9ba686fae02e01cd899261fe6793">More...</a><br /></td></tr>
<tr class="separator:a3f5b9ba686fae02e01cd899261fe6793"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e523d76f261801c3622f00458333320"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a7e523d76f261801c3622f00458333320">set_found</a> (std::shared_ptr&lt; <a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html">BFS_Vertex</a> &gt; v_parent)</td></tr>
<tr class="memdesc:a7e523d76f261801c3622f00458333320"><td class="mdescLeft">&#160;</td><td class="mdescRight">set_found：发现本顶点  <a href="#a7e523d76f261801c3622f00458333320">More...</a><br /></td></tr>
<tr class="separator:a7e523d76f261801c3622f00458333320"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a73aa1fb33a2616818b709d04e79a007e"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a73aa1fb33a2616818b709d04e79a007e">to_string</a> ()</td></tr>
<tr class="memdesc:a73aa1fb33a2616818b709d04e79a007e"><td class="mdescLeft">&#160;</td><td class="mdescRight">to_string：返回顶点的字符串描述  <a href="#a73aa1fb33a2616818b709d04e79a007e">More...</a><br /></td></tr>
<tr class="separator:a73aa1fb33a2616818b709d04e79a007e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex.html">IntroductionToAlgorithm::GraphAlgorithm::Vertex&lt; KType &gt;</a></td></tr>
<tr class="memitem:a6a0b0403db78f786443e8827e6bb6af9 inherit pub_methods_struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex.html#a6a0b0403db78f786443e8827e6bb6af9">Vertex</a> ()</td></tr>
<tr class="memdesc:a6a0b0403db78f786443e8827e6bb6af9 inherit pub_methods_struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex"><td class="mdescLeft">&#160;</td><td class="mdescRight">默认构造函数，将<code>key</code>设为<code>KType()</code>，编号设为-1  <a href="#a6a0b0403db78f786443e8827e6bb6af9">More...</a><br /></td></tr>
<tr class="separator:a6a0b0403db78f786443e8827e6bb6af9 inherit pub_methods_struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a047edb0a5351588129aad113a93eba54 inherit pub_methods_struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex.html#a047edb0a5351588129aad113a93eba54">Vertex</a> (const <a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex.html#a14e958c58a404474853491eb811954cc">KeyType</a> &amp;k)</td></tr>
<tr class="memdesc:a047edb0a5351588129aad113a93eba54 inherit pub_methods_struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex"><td class="mdescLeft">&#160;</td><td class="mdescRight">显式构造函数，指定<code>key</code>  <a href="#a047edb0a5351588129aad113a93eba54">More...</a><br /></td></tr>
<tr class="separator:a047edb0a5351588129aad113a93eba54 inherit pub_methods_struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9ed1eda4a4b48a8329acc8bd4b58150f inherit pub_methods_struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex.html#a9ed1eda4a4b48a8329acc8bd4b58150f">Vertex</a> (const <a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex.html#a14e958c58a404474853491eb811954cc">KeyType</a> &amp;k, <a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex.html#a290c84c0dcf159f833c72c47a2d4d44a">VIDType</a> d)</td></tr>
<tr class="memdesc:a9ed1eda4a4b48a8329acc8bd4b58150f inherit pub_methods_struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex"><td class="mdescLeft">&#160;</td><td class="mdescRight">显式构造函数，指定<code>key</code>和编号  <a href="#a9ed1eda4a4b48a8329acc8bd4b58150f">More...</a><br /></td></tr>
<tr class="separator:a9ed1eda4a4b48a8329acc8bd4b58150f inherit pub_methods_struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8b0ab227cd3945eace9ef55f8837925 inherit pub_methods_struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex"><td class="memItemLeft" align="right" valign="top">virtual std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex.html#aa8b0ab227cd3945eace9ef55f8837925">to_string</a> () const </td></tr>
<tr class="memdesc:aa8b0ab227cd3945eace9ef55f8837925 inherit pub_methods_struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex"><td class="mdescLeft">&#160;</td><td class="mdescRight">to_string：返回顶点的字符串描述  <a href="#aa8b0ab227cd3945eace9ef55f8837925">More...</a><br /></td></tr>
<tr class="separator:aa8b0ab227cd3945eace9ef55f8837925 inherit pub_methods_struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a7ab527ab8514bcb65e56edbe62b28fbb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a3f00f12565def71750f1f163e0e52305">COLOR</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a7ab527ab8514bcb65e56edbe62b28fbb">color</a></td></tr>
<tr class="separator:a7ab527ab8514bcb65e56edbe62b28fbb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a11202710469656d7fb04635430355c41"><td class="memItemLeft" align="right" valign="top">std::shared_ptr&lt; <a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html">BFS_Vertex</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a11202710469656d7fb04635430355c41">parent</a></td></tr>
<tr class="separator:a11202710469656d7fb04635430355c41"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_attribs_struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex"><td colspan="2" onclick="javascript:toggleInherit('pub_attribs_struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex')"><img src="closed.png" alt="-"/>&#160;Public Attributes inherited from <a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex.html">IntroductionToAlgorithm::GraphAlgorithm::Vertex&lt; KType &gt;</a></td></tr>
<tr class="memitem:a5bcfb4e0ba9450b8ebb2543069772d1f inherit pub_attribs_struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex.html#a14e958c58a404474853491eb811954cc">KeyType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex.html#a5bcfb4e0ba9450b8ebb2543069772d1f">key</a></td></tr>
<tr class="separator:a5bcfb4e0ba9450b8ebb2543069772d1f inherit pub_attribs_struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a76668b285452856d184a245b7b35b7c1 inherit pub_attribs_struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex.html#a290c84c0dcf159f833c72c47a2d4d44a">VIDType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex.html#a76668b285452856d184a245b7b35b7c1">id</a></td></tr>
<tr class="separator:a76668b285452856d184a245b7b35b7c1 inherit pub_attribs_struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename KType&gt;<br />
struct IntroductionToAlgorithm::GraphAlgorithm::BFS_Vertex&lt; KType &gt;</h3>

<p>BFS_Vertex：用于广度优先搜索的顶点类型，算法导论22章22.2节 </p>
<p>广度优先搜索的顶点类型继承自<code><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex.html" title="Vertex：图的顶点，算法导论22章22.1节 ">Vertex</a></code>模板类型，它比<code><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex.html" title="Vertex：图的顶点，算法导论22章22.1节 ">Vertex</a></code>多了两个数据成员：</p>
<ul>
<li><code>color</code>：顶点的颜色。顶点可以有三种颜色，分别为<code><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a3f00f12565def71750f1f163e0e52305a08d0012388564e95c3b4a7407cf04965">BFS_Vertex::COLOR::BLACK</a></code>、<code><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a3f00f12565def71750f1f163e0e52305ab5bf627e448384cf3a4c35121ca6008d">BFS_Vertex::COLOR::WHITE</a></code>、<code><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a3f00f12565def71750f1f163e0e52305a48bf014c704c9eaae100a98006a37bf7">BFS_Vertex::COLOR::GRAY</a></code></li>
<li><code>parent</code>: 指向父顶点的强引用</li>
</ul>
<p>广度优先搜索的顶点类型还支持以下两个操作：</p>
<ul>
<li><code><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a3f5b9ba686fae02e01cd899261fe6793" title="set_source：设本顶点为源点 ">set_source()</a></code>：将本顶点设为源点</li>
<li><code>set_found(v_parent)</code>：发现本顶点 </li>
</ul>

<p>Definition at line <a class="el" href="bfs__vertex_8h_source.html#l00042">42</a> of file <a class="el" href="bfs__vertex_8h_source.html">bfs_vertex.h</a>.</p>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a class="anchor" id="a1e47ba34939458c68d7ccee8ebeccad2"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename KType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef KType <a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html">IntroductionToAlgorithm::GraphAlgorithm::BFS_Vertex</a>&lt; KType &gt;::<a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a1e47ba34939458c68d7ccee8ebeccad2">KeyType</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>顶点存储数据的类型 </p>

<p>Definition at line <a class="el" href="bfs__vertex_8h_source.html#l00046">46</a> of file <a class="el" href="bfs__vertex_8h_source.html">bfs_vertex.h</a>.</p>

</div>
</div>
<a class="anchor" id="a62cef758843cdaeefae2fc196f6bdb46"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename KType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef int <a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html">IntroductionToAlgorithm::GraphAlgorithm::BFS_Vertex</a>&lt; KType &gt;::<a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a62cef758843cdaeefae2fc196f6bdb46">VIDType</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>顶点编号的数据类型 </p>

<p>Definition at line <a class="el" href="bfs__vertex_8h_source.html#l00045">45</a> of file <a class="el" href="bfs__vertex_8h_source.html">bfs_vertex.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Enumeration Documentation</h2>
<a class="anchor" id="a3f00f12565def71750f1f163e0e52305"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename KType &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a3f00f12565def71750f1f163e0e52305">IntroductionToAlgorithm::GraphAlgorithm::BFS_Vertex::COLOR</a></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">strong</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="a3f00f12565def71750f1f163e0e52305ab5bf627e448384cf3a4c35121ca6008d"></a>WHITE&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a3f00f12565def71750f1f163e0e52305a48bf014c704c9eaae100a98006a37bf7"></a>GRAY&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a3f00f12565def71750f1f163e0e52305a08d0012388564e95c3b4a7407cf04965"></a>BLACK&#160;</td><td class="fielddoc">
</td></tr>
</table>

<p>Definition at line <a class="el" href="bfs__vertex_8h_source.html#l00047">47</a> of file <a class="el" href="bfs__vertex_8h_source.html">bfs_vertex.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ad9540a9d7487eea8ece6ac1b0bbfcc22"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename KType &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html">IntroductionToAlgorithm::GraphAlgorithm::BFS_Vertex</a>&lt; KType &gt;::<a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html">BFS_Vertex</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>默认构造函数，将<code>color</code>设为白色 </p>

<p>Definition at line <a class="el" href="bfs__vertex_8h_source.html#l00051">51</a> of file <a class="el" href="bfs__vertex_8h_source.html">bfs_vertex.h</a>.</p>

</div>
</div>
<a class="anchor" id="abf41ef42dff5af509e9b42658882f604"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename KType &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html">IntroductionToAlgorithm::GraphAlgorithm::BFS_Vertex</a>&lt; KType &gt;::<a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html">BFS_Vertex</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a1e47ba34939458c68d7ccee8ebeccad2">KeyType</a> &amp;&#160;</td>
          <td class="paramname"><em>k</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>显式构造函数，指定<code>key</code> </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">k:顶点存放的数据</td><td>顶点的颜色默认设为白色 </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="bfs__vertex_8h_source.html#l00058">58</a> of file <a class="el" href="bfs__vertex_8h_source.html">bfs_vertex.h</a>.</p>

</div>
</div>
<a class="anchor" id="a3765fd695d8452180bafbb42baec744f"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename KType &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html">IntroductionToAlgorithm::GraphAlgorithm::BFS_Vertex</a>&lt; KType &gt;::<a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html">BFS_Vertex</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a1e47ba34939458c68d7ccee8ebeccad2">KeyType</a> &amp;&#160;</td>
          <td class="paramname"><em>k</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a62cef758843cdaeefae2fc196f6bdb46">VIDType</a>&#160;</td>
          <td class="paramname"><em>d</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>显式构造函数，指定<code>key</code>和编号 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">k:顶点存放的数据</td><td></td></tr>
    <tr><td class="paramname">d:顶点的编号</td><td>顶点的颜色默认设为白色 </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="bfs__vertex_8h_source.html#l00066">66</a> of file <a class="el" href="bfs__vertex_8h_source.html">bfs_vertex.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a7e523d76f261801c3622f00458333320"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename KType &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html">IntroductionToAlgorithm::GraphAlgorithm::BFS_Vertex</a>&lt; KType &gt;::set_found </td>
          <td>(</td>
          <td class="paramtype">std::shared_ptr&lt; <a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html">BFS_Vertex</a>&lt; KType &gt; &gt;&#160;</td>
          <td class="paramname"><em>v_parent</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>set_found：发现本顶点 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">v_parent:父顶点的强引用</td><td>发现本顶点要执行两个操作：</td></tr>
  </table>
  </dd>
</dl>
<ul>
<li>将本顶点的颜色设为灰色</li>
<li>将本顶点的<code>parent</code>设为<code>v_parent</code></li>
</ul>
<p>这里要求<code>v_parent</code>非空。若<code>v_parent</code>为空则抛出异常 </p>

<p>Definition at line <a class="el" href="bfs__vertex_8h_source.html#l00094">94</a> of file <a class="el" href="bfs__vertex_8h_source.html">bfs_vertex.h</a>.</p>

</div>
</div>
<a class="anchor" id="a3f5b9ba686fae02e01cd899261fe6793"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename KType &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html">IntroductionToAlgorithm::GraphAlgorithm::BFS_Vertex</a>&lt; KType &gt;::set_source </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>set_source：设本顶点为源点 </p>
<p>将本顶点设为源点要执行两个操作：</p>
<ul>
<li>将本顶点的颜色设为灰色</li>
<li>将本顶点的<code>parent</code>设为空 </li>
</ul>

<p>Definition at line <a class="el" href="bfs__vertex_8h_source.html#l00076">76</a> of file <a class="el" href="bfs__vertex_8h_source.html">bfs_vertex.h</a>.</p>

</div>
</div>
<a class="anchor" id="a73aa1fb33a2616818b709d04e79a007e"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename KType &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::string <a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html">IntroductionToAlgorithm::GraphAlgorithm::BFS_Vertex</a>&lt; KType &gt;::to_string </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>to_string：返回顶点的字符串描述 </p>
<dl class="section return"><dt>Returns</dt><dd>:顶点的字符串描述</dd></dl>
<p>再<code><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex.html" title="Vertex：图的顶点，算法导论22章22.1节 ">Vertex</a></code>基类的基础上输出<code>color</code>以及<code>parent</code>信息。 </p>

<p>Definition at line <a class="el" href="bfs__vertex_8h_source.html#l00110">110</a> of file <a class="el" href="bfs__vertex_8h_source.html">bfs_vertex.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="a7ab527ab8514bcb65e56edbe62b28fbb"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename KType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html#a3f00f12565def71750f1f163e0e52305">COLOR</a> <a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html">IntroductionToAlgorithm::GraphAlgorithm::BFS_Vertex</a>&lt; KType &gt;::color</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>顶点颜色 </p>

<p>Definition at line <a class="el" href="bfs__vertex_8h_source.html#l00133">133</a> of file <a class="el" href="bfs__vertex_8h_source.html">bfs_vertex.h</a>.</p>

</div>
</div>
<a class="anchor" id="a11202710469656d7fb04635430355c41"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename KType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">std::shared_ptr&lt;<a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html">BFS_Vertex</a>&gt; <a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html">IntroductionToAlgorithm::GraphAlgorithm::BFS_Vertex</a>&lt; KType &gt;::parent</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>顶点父顶点的强引用 </p>

<p>Definition at line <a class="el" href="bfs__vertex_8h_source.html#l00134">134</a> of file <a class="el" href="bfs__vertex_8h_source.html">bfs_vertex.h</a>.</p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>src/graph_algorithms/basic_graph/graph_representation/graph_vertex/<a class="el" href="bfs__vertex_8h_source.html">bfs_vertex.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespace_introduction_to_algorithm.html">IntroductionToAlgorithm</a></li><li class="navelem"><a class="el" href="namespace_introduction_to_algorithm_1_1_graph_algorithm.html">GraphAlgorithm</a></li><li class="navelem"><a class="el" href="struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_b_f_s___vertex.html">BFS_Vertex</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.10 </li>
  </ul>
</div>
</body>
</html>
